// 缓存
class Storage {
  getStorage (k) {
    return sessionStorage.getItem(k)
  }

  setStorage (k, v) {
    if (Object.prototype.toString.call(v) === '[object Object]') {
      sessionStorage.setItem(k, JSON.stringify(v))
    } else {
      sessionStorage.setItem(k, v)
    }
  }

  removeStorage (k) {
    sessionStorage.removeItem(k)
  }
}

export default new Storage()
